package _1ChapterOne._5IntroduceExplainingVariable;

import _1ChapterOne._4ReplaceTempWithQuery.BaseClass;

public class Test2 extends BaseClass {
    public double getPrice() {
        return getBasePrice() - getQuantityDiscount() + getShipping();
    }

    public int getBasePrice() {
        return _itemPrice * _quantity;
    }

    public double getQuantityDiscount() {
        return Math.max(0, _quantity - 500 * _quantity * 0.05);
    }

    public double getShipping() {
        return Math.min(100.0, _quantity * _itemPrice * 0.01);
    }
}
